<template>
    <div>
        <div class="title-style">问题管控</div>
        <Card>
            <div v-for="(item,index) in problemList" :key="index" class="container">
                <Form :model="item" label-position="right">
                    <Row>
                        <Col span="24">
                            <FormItem class="required" label="问题类型:" prop="type">
                                {{item.type}}
                            </FormItem>
                        </Col>
                        <Col span="24">
                            <FormItem class="required" label="发送类型:" prop="send_type">
                                <span v-if="item.send_type == '1'">在线监督治理平台</span>
                                <span v-if="item.send_type == '2'">单位（部门）主要领导</span>
                                <span v-if="item.send_type == '3'">单位（部门）分管领导</span>
                                <span v-if="item.send_type == '4'">单位（部门）业务处室负责人</span>
                                <span v-if="item.send_type == '5'">单位（部门）经办人</span>
                            </FormItem>
                        </Col>
                    </Row>
                    <Divider/>
                </Form>
            </div>
        </Card>
    </div>
</template>

<script>
import { selectSstGovProblemByBaseList } from '@/api/setting'

export default {
  name: 'ProblemDetail',
  data () {
    return {
      problemList: [],
      baseID: ''
    }
  },
  methods: {
    success (val) {
      val = this.$common.xeUtils.isEmpty(val) ? '操作成功' : val
      this.$Message.success(val)
    },
    error (data) {
      this.$Message.error({
        content: '操作失败,\n' + data.errmsg
      })
    },
    getInfoByID () {
      let param = { base_info_id: this.baseID }
      selectSstGovProblemByBaseList(param).then(ret => {
        let data = ret.data
        if (data.errcode === 0) {
          this.problemList = data.data
        } else {
          this.error(data)
        }
      })
    }
  },
  mounted () {
    this.baseID = this.$route.query.id
    this.getInfoByID()
  }
}
</script>

<style scoped>
    .container {
        padding: 15px;
    }

    /deep/ .ivu-form-item-label {
        font-weight: bold;
    }
</style>
